import { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    redirect: 'index',
    children: [
      {
        path: '/index',
        component: () => import('pages/IndexPage.vue'),
      },
      {
        path: '/config',
        component: () => import('pages/ConfigPage.vue'),
      },
      {
        path: '/terminal',
        component: () => import('pages/TerminalPage.vue'),
      },
      {
        path: '/database',
        component: () => import('pages/DatabasePage.vue'),
      },
      {
        path: '/view',
        component: () => import('pages/DataViewPage.vue'),
      },
      {
        path: '/template',
        component: () => import('pages/TemplatePage.vue'),
      },
      {
        path: '/api',
        component: () => import('pages/ApiPage.vue'),
      },
    ],
  },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
  {
    path: '/drag',
    component: () => import('components/DragPage.vue'),
  },
  {
    name: 'login',
    path: '/login',
    component: () => import('layouts/LoginLayout.vue'),
  },
];
export default routes;
